package com.sojson.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.sojson.base.impl.BaseDaoImpl;
import com.sojson.dao.ShippersDao;
import com.sojson.entity.bo.Select;
import com.sojson.entity.po.Shippers;

/**
 * Dao实现类(目的:把分页插件从Service层分离,这样就不用每次调Dao接口都要分页)
 * 
 * @author liu
 * @date 2021-04-01
 */
@Repository
public class ShippersDaoImpl extends BaseDaoImpl<ShippersDao, Shippers> implements ShippersDao {

    @Resource
    private ShippersDao shippersDao;

    /**
     * 单条插入
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int insert(Shippers shippers) {
        return shippersDao.insert(shippers);
    }

    /**
     * 批量插入
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int insertList(List<Shippers> shipperss) {
        return shippersDao.insertList(shipperss);
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByDto(Shippers shippers) {
        return shippersDao.deleteByDto(shippers);
    }

    /**
     * 统计全部数量
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public int countAll() {
        return shippersDao.countAll();
    }

    /**
     * 查询所有
     * 
     * @return
     * @throws SQLException
     */
    @Override
    public List<Shippers> listAll() {
        return shippersDao.listAll();
    }

    /**
     * 根据对象统计数量
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int countByDto(Shippers shippers) {
        return shippersDao.countByDto(shippers);
    }

    /**
     * 根据对象查询
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public List<Shippers> listByDto(Shippers shippers) {
        startPage(shippers);
        return shippersDao.listByDto(shippers);
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteById(Integer id) {
        return shippersDao.deleteById(id);
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public int deleteByIdList(ArrayList<Integer> ids) {
        return shippersDao.deleteByIdList(ids);
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int updateById(Shippers shippers) {
        return shippersDao.updateById(shippers);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticByIdList(Shippers shippers) {
        return shippersDao.updateStaticByIdList(shippers);
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param shipperss
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangeByIdList(ArrayList<Shippers> shipperss) {
        return shippersDao.updateChangeByIdList(shipperss);
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int updatePartialById(Shippers shippers) {
        return shippersDao.updatePartialById(shippers);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public int updateStaticPartialByIdList(Shippers shippers) {
        return shippersDao.updateStaticPartialByIdList(shippers);
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param shipperss
     * @return
     * @throws SQLException
     */
    @Override
    public int updateChangePartialByIdList(ArrayList<Shippers> shipperss) {
        return shippersDao.updateChangePartialByIdList(shipperss);
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     * @throws SQLException
     */
    @Override
    public Shippers findById(Integer id) {
        return shippersDao.findById(id);
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<Shippers> findByIdList(ArrayList<Integer> ids) {
        return shippersDao.findByIdList(ids);
    }

    /**
     * 通过对象查询id列表
     * 
     * @param shippers
     * @return
     * @throws SQLException
     */
    @Override
    public ArrayList<Integer> findIdByDto(Shippers shippers) {
        return shippersDao.findIdByDto(shippers);
    }

    /**
     * 清空数据(物理清空)
     * 
     * @throws SQLException
     */
    @Override
    public void clear() {
        shippersDao.clear();
    }

    /**
     * 获取快递公司下拉列表
     * 
     * @param shippers
     * @return
     */
    @Override
    public List<Select> select(Shippers shippers) {
        startPage(shippers);
        return shippersDao.select(shippers);
    }

}